LanguageExt.Core

LanguageExt.Core Monads Alternative Value Monads ValidationT

Contents

record ValidationT <L, M, A> (K<M, Validation<L, A>> runValidation) Source #

where M : Monad<M>
where L : Monoid<L>

ValidationT monad transformer, which allows for an optional result.

Parameters

type M

Given monad trait

type L

Left value type

type A

Bound value type

param runValidation

Transducer that represents the transformer operation

Methods

method ValidationT<L, M, A> Success (A value) Source #

Lift a pure value into the monad-transformer

Parameters

param value

Value to lift

returns

ValidationT

method ValidationT<L, M, A> Fail (L value) Source #

Lift a fail value into the monad-transformer

Parameters

param value

Value to lift

returns

ValidationT

method ValidationT<L, M, A> Lift (Pure<A> pure) Source #

Lifts a given monad into the transformer

Parameters

param pure

Monad to lift

returns

ValidationT

method ValidationT<L, M, A> Lift (Validation<L, A> Validation) Source #

Lifts a given monad into the transformer

Parameters

param Validation

Monad to lift

returns

ValidationT

method ValidationT<L, M, A> Lift (Fail<L> fail) Source #

Lifts a given monad into the transformer

Parameters

param fail

Monad to lift

returns

ValidationT

method ValidationT<L, M, A> Lift (K<M, A> monad) Source #

Lifts a given monad into the transformer

Parameters

param monad

Monad to lift

returns

ValidationT

method ValidationT<L, M, A> LiftIO (IO<A> monad) Source #

Lifts a given monad into the transformer

Parameters

param monad

Monad to lift

returns

ValidationT

method K<M, B> Match <B> (Func<A, B> Succ, Func<L, B> Fail) Source #

method K<M, Validation<L, A>> Run () Source #

method ValidationT<L, M1, B> MapT <M1, B> (Func<K<M, Validation<L, A>>, K<M1, Validation<L, B>>> f) Source #

where M1 : Monad<M1>

Maps the bound monad

Parameters

type M1

Target monad type

type B

Target bound value type

param f

Mapping function

returns

Mapped monad

method ValidationT<L, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #

Maps the given monad

Parameters

param f

Mapping function

method ValidationT<L, M, B> Map <B> (Func<A, B> f) Source #

Maps the bound value

Parameters

type B

Target bound value type

param f

Mapping function

returns

ValidationT

method ValidationT<L, M, B> Select <B> (Func<A, B> f) Source #

Maps the bound value

Parameters

type B

Target bound value type

param f

Mapping transducer

returns

ValidationT

method ValidationT<L, M, B> Bind <B> (Func<A, K<ValidationT<L, M>, B>> f) Source #

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

ValidationT

method ValidationT<L, M, B> Bind <B> (Func<A, ValidationT<L, M, B>> f) Source #

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

ValidationT

method ValidationT<L, M, B> Bind <B> (Func<A, IO<B>> f) Source #

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

ValidationT

method ValidationT<L, M, B> Bind <B> (Func<A, Pure<B>> f) Source #

Monad bind operation

Parameters

type B

Target bound value type

param f

Mapping function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <B, C> (Func<A, K<ValidationT<L, M>, B>> bind, Func<A, B, C> project) Source #

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <B, C> (Func<A, ValidationT<L, M, B>> bind, Func<A, B, C> project) Source #

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <B, C> (Func<A, Validation<L, B>> bind, Func<A, B, C> project) Source #

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

Operators

operator | (ValidationT<L, M, A> ma, ValidationT<L, M, A> mb) Source #

operator & (ValidationT<L, M, A> ma, ValidationT<L, M, A> mb) Source #

class ValidationTExt Source #

Validation monad extensions

Methods

method ValidationT<L, M, A> As <L, M, A> (this K<ValidationT<L, M>, A> ma) Source #

where M : Monad<M>
where L : Monoid<L>

method ValidationT<L, M, A> Flatten <L, M, A> (this ValidationT<L, M, ValidationT<L, M, A>> mma) Source #

where M : Monad<M>
where L : Monoid<L>

Monadic join

method ValidationT<L, IO, A> Flatten <L, A> (this Task<ValidationT<L, IO, A>> tma) Source #

where L : Monoid<L>

Get the outer task and wrap it up in a new IO within the EitherT IO

method ValidationT<L, IO, A> ToIO <L, A> (this Task<Validation<L, A>> ma) Source #

where L : Monoid<L>

Lift the task

method ValidationT<L, M, C> SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, K<ValidationT<L, M>, B>> bind, Func<A, B, C> project) Source #

where M : Monad<M>
where L : Monoid<L>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, C> SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, ValidationT<L, M, B>> bind, Func<A, B, C> project) Source #

where M : Monad<M>
where L : Monoid<L>

Monad bind operation

Parameters

type B

Intermediate bound value type

type C

Target bound value type

param bind

Monadic bind function

param project

Projection function

returns

ValidationT

method ValidationT<L, M, B> Apply <L, M, A, B> (this ValidationT<L, M, Func<A, B>> mf, ValidationT<L, M, A> ma) Source #

where M : Monad<M>
where L : Monoid<L>

Applicative apply

method ValidationT<L, M, B> Action <L, M, A, B> (this ValidationT<L, M, A> ma, ValidationT<L, M, B> mb) Source #

where M : Monad<M>
where L : Monoid<L>

Applicative action

class ValidationT <F, M> Source #

Methods

method ValidationT<F, M, A> Right <A> (A value) Source #

method ValidationT<F, M, A> Left <A> (F value) Source #

method ValidationT<F, M, A> lift <A> (Validation<F, A> ma) Source #

method ValidationT<F, M, A> lift <A> (Pure<A> ma) Source #

method ValidationT<F, M, A> lift <A> (Fail<F> ma) Source #

method ValidationT<F, M, A> liftIO <A> (IO<A> ma) Source #

class ValidationT Source #

Methods

method ValidationT<L, M, B> bind <L, M, A, B> (ValidationT<L, M, A> ma, Func<A, ValidationT<L, M, B>> f) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, B> map <L, M, A, B> (Func<A, B> f, ValidationT<L, M, A> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> Right <L, M, A> (A value) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> Left <L, M, A> (L value) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, B> apply <L, M, A, B> (ValidationT<L, M, Func<A, B>> mf, ValidationT<L, M, A> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, B> action <L, M, A, B> (ValidationT<L, M, A> ma, ValidationT<L, M, B> mb) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> lift <L, M, A> (Validation<L, A> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> lift <L, M, A> (K<M, A> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> lift <L, M, A> (Pure<A> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> lift <L, M, A> (Fail<L> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method ValidationT<L, M, A> liftIO <L, M, A> (IO<A> ma) Source #

where L : Monoid<L>
where M : Monad<M>

method K<M, B> match <L, M, A, B> (ValidationT<L, M, A> ma, Func<A, B> Succ, Func<L, B> Fail) Source #

where L : Monoid<L>
where M : Monad<M>

class ValidationT <F, M> Source #

where M : Monad<M>
where F : Monoid<F>

Trait implementation for ValidationT

Parameters

type M

Given monad trait